package com.huaboot.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;


/**
 * 上传模式枚举
 */
@Getter
@AllArgsConstructor
public enum UploadModeEnum {

    /**
     * 服务器本地上传
     */
    PROJECT_UPLOAD("Project", "projectUploadStrategyImpl"),
    /**
     * Oss上传(阿里云)
     */
    OSS_UPLOAD("Oss", "ossUploadStrategyImpl"),

    /**
     * Minio上传
     */
    Minio_UPLOAD("Minio", "minioUploadStrategyImpl"),


    /**
     * Kodo上传（七牛云）
     */
    KODO_UPLOAD("Kodo", "kodoUploadStrategyImpl");




    /**
     * 模式
     */
    private final String mode;

    /**
     * 策略
     */
    private final String strategy;



    /**
     * 获取上传枚举值
     * @param mode 模式名称
     */
    public static String getEnumByMode(String mode) {
        for (UploadModeEnum value : UploadModeEnum.values()) {
            if (value.getMode().equals(mode)){
                return value.getStrategy();
            }
        }
        return null;
    }


}
